package com.szrt.java.day20161223.wrl.t03;

import java.util.Scanner;

public class Tax {
	public static void main(String[] args) {
		double salary;		//工资		
		double baseTax;		//起征点
		double left;		//需缴纳的工资 = 工资 - 起征点
		double tax;			//应缴个税
		
		Scanner sc = new Scanner(System.in);
		System.out.println("请输入你的月薪：");
		salary = sc.nextDouble();
		System.out.println("请输入起征点：");
		baseTax = sc.nextDouble();
		
		left = salary - baseTax;
		if(left<=0){
			tax = 0;
			System.out.println("继续努力，你的工资不需要交税");
		}else if(left <= 1500){
			tax = left * 0.03-0;
		}else if(left <= 1500){
			tax = left * 0.1-105;
		}else if(left <= 1500){
			tax = left * 0.25-1005;
		}else if(left <= 1500){
			tax = left * 0.3-2755;
		}else if(left <= 1500){
			tax = left * 0.35-5505;
		}else{
			tax = left * 0.45-13505;
		}
		System.out.println("你需要交的税额为："+tax);
		sc.close();
	}

}
